<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 文章验证器
 */
class Course extends AdminBase
{
    
    // 验证规则
    protected $rule =   [
        'name'          => 'require',
        'describe'   => 'require',
        'money'=>'>=:0',
        'collections'=>'gt:0',
        'cover_id'   => 'gt:0',

    ];

    // 验证提示
    protected $message  =   [
        'name.require'         => '课堂名称不能为空',
        'describe.require'  => '课堂亮点不能为空',
         'money'=>'价格不能为负数',
        'collections'=>'总集数必须大于0',
          'cover_id'  => '图片必须上传',
    ];
    
    // 应用场景
    protected $scene = [
        'edit'  =>  ['name', 'introduction', 'describe','money','collections','cover_id']
    ];
}
